import { defHttp } from '/@/utils/http/axios';
import { ApiCommon } from '../common';

const { CHARGE_API, ADMIN_USER_DICT_API } = ApiCommon;

enum Api {
  RECEIVED_RECORD = '/compariso/admin/payReceivedRecord/get/page', //对账记录分页
  PRRINVEN_TORY = '/compariso/admin/prrInventory/get/page', //对账明细记录
  DICT_PARAMS = '/params', //字典
  REPLEN_BILL = '/compariso/admin/prrInventory/replenishBill', //补账
}

// 对账记录分页
export const getReceived = (params: object) =>
  defHttp.get({ url: CHARGE_API + Api.RECEIVED_RECORD, params });

//   对账明细
export const getPrronventory = (params: object) =>
  defHttp.get({ url: CHARGE_API + Api.PRRINVEN_TORY, params });

// 字典
export const getDict = (params: object) =>
  defHttp.get({ url: ADMIN_USER_DICT_API + Api.DICT_PARAMS + '/' + params.key });

//销账
export const PostReplen = (data: object) =>
  defHttp.post({ url: CHARGE_API + Api.REPLEN_BILL, data });
